#define _CRT_SECURE_NO_WARNINGS

#include "MergeSort.h"

void MergeSortTest()
{
	int arr[] = { 6,2,8,4,9,3,7,5,1 };
	int sz = sizeof(arr) / sizeof(arr[0]);

	int* tmp = (int*)malloc(sizeof(int) * sz);
	if (tmp == NULL)
	{
		perror("malloc fail");
		exit(-1);
	}

	MergeSort(arr, 0, sz - 1, tmp);
	ArrayPrint(arr, sz);
}

void MergeSortNonRTest()
{
	int arr[] = { 6,2,8,4,9,3,7,5,1,4,1,8,3,2,7,5,1,9,2,7,3,4,5,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);

	MergeSortNonR(arr, sz);
	ArrayPrint(arr, sz);
}

int main()
{
	MergeSortTest();
	MergeSortNonRTest();

	return 0;
} 